package com.sg.controller.bff;

import com.sg.service.biz.bff.OrgService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Org", tags = {"Org"})
@RestController
// @RequestMapping("/oms/org/")
public class OrgController {

    @Autowired
    OrgService orgService;

    /**
     * B1-3新增部门（管理）
     * gen by moon at 9/3/2022, 6:01:29 PM
     */
    @PostMapping("/oms/mgt/org/addDept")
    @ApiOperation(value = "B1-3新增部门（管理）", response = OkrResult.class)
    public OkrResult<BffAddDeptRespDto> addDept(@RequestBody(required = false) @Validated BffAddDeptReqDto reqDTO) {
        return OkrResult.success(orgService.addDept(reqDTO));
    }

    /**
     * B1-3查询部门树状结构列表
     * gen by moon at 10/16/2022, 6:04:00 AM
     */
    @PostMapping("/oms/org/queryDeptTreeList")
    @ApiOperation(value = "B1-3查询部门树状结构列表", response = OkrResult.class)
    public OkrResult<BffQueryDeptTreeListRespDto> queryDeptTreeList(@RequestBody(required = false) @Validated BffQueryDeptTreeListReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptTreeList(reqDTO));
    }

    /**
     * B1-3查询部门树状结构列表（边界）
     */
    @PostMapping("/oms/org/queryDeptBorderTreeList")
    @ApiOperation(value = "B1-3查询部门树状结构列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryDeptBorderTreeListRespDto> queryDeptBorderTreeList(@RequestBody(required = false) @Validated BffQueryDeptBorderTreeListReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptBorderTreeList(reqDTO));
    }

    /**
     * B1-3查询当前我的部门列表（边界）
     * gen by moon at 8/10/2022, 3:37:41 AM
     */
    @PostMapping("/oms/org/queryMyCurrentDeptListBorder")
    @ApiOperation(value = "B1-3查询当前我的部门列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryMyCurrentDeptListBorderRespDto> queryMyCurrentDeptListBorder(@RequestBody(required = false) @Validated BffQueryMyCurrentDeptListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryMyCurrentDeptListBorder(reqDTO));
    }

    /**
     * B1-3取消冻结组织（管理）
     * gen by moon at 8/10/2022, 3:33:02 AM
     */
    @PostMapping("/oms/mgt/org/undoFreezeOrg")
    @ApiOperation(value = "B1-3取消冻结组织（管理）", response = OkrResult.class)
    public OkrResult<BffUndoFreezeOrgRespDto> undoFreezeOrg(@RequestBody(required = false) @Validated BffUndoFreezeOrgReqDto reqDTO) {
        return OkrResult.success(orgService.undoFreezeOrg(reqDTO));
    }

    /**
     * B1-3冻结组织（管理）
     * gen by moon at 8/10/2022, 3:32:58 AM
     */
    @PostMapping("/oms/mgt/org/freezeOrg")
    @ApiOperation(value = "B1-3冻结组织（管理）", response = OkrResult.class)
    public OkrResult<BffFreezeOrgRespDto> freezeOrg(@RequestBody(required = false) @Validated BffFreezeOrgReqDto reqDTO) {
        return OkrResult.success(orgService.freezeOrg(reqDTO));
    }

    /**
     * B1-3删除部门（管理）
     * gen by moon at 9/2/2022, 6:37:23 PM
     */
    @PostMapping("/oms/mgt/org/deleteDept")
    @ApiOperation(value = "B1-3删除部门（管理）", response = OkrResult.class)
    public OkrResult<BffDeleteDeptRespDto> deleteDept(@RequestBody(required = false) @Validated BffDeleteDeptReqDto reqDTO) {
        return OkrResult.success(orgService.deleteDept(reqDTO));
    }

    /**
     * B1-2查中基层部门(边界)
     * gen by moon at 9/13/2022, 3:43:48 AM
     */
    @PostMapping("/oms/org/queryMidBaseCourseDetailBorder")
    @ApiOperation(value = "B1-2查中基层部门(边界)", response = OkrResult.class)
    public OkrResult<BffQueryMidBaseCourseDetailBorderRespDto> queryMidBaseCourseDetailBorder(@RequestBody(required = false) @Validated BffQueryMidBaseCourseDetailBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryMidBaseCourseDetailBorder(reqDTO));
    }

    /**
     * B1-3查询部门树状结构列表（边界）
     * gen by moon at 10/16/2022, 6:04:02 AM
     */
    @PostMapping("/oms/org/queryDeptTreeListBorder")
    @ApiOperation(value = "B1-3查询部门树状结构列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryDeptTreeListBorderRespDto> queryDeptTreeListBorder(@RequestBody(required = false) @Validated BffQueryDeptTreeListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptTreeListBorder(reqDTO));
    }

    /**
     * B1-3查询树状结构下级部门列表（边界）
     * gen by moon at 8/10/2022, 3:38:13 AM
     */
    @PostMapping("/oms/mgt/org/querySubordinateDeptTreeListBorder")
    @ApiOperation(value = "B1-3查询树状结构下级部门列表（边界）", response = OkrResult.class)
    public OkrResult<BffQuerySubordinateDeptTreeListBorderRespDto> querySubordinateDeptTreeListBorder(@RequestBody(required = false) @Validated BffQuerySubordinateDeptTreeListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.querySubordinateDeptTreeListBorder(reqDTO));
    }

    /**
     * B1-3查询组织列表（边界）
     * gen by moon at 8/20/2022, 5:53:33 PM
     */
    @PostMapping("/oms/mgt/org/queryOrgListBorder")
    @ApiOperation(value = "B1-3查询组织列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryOrgListBorderRespDto> queryOrgListBorder(@RequestBody(required = false) @Validated BffQueryOrgListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryOrgListBorder(reqDTO));
    }


    /**
     * B1-3查询存档部门条件（管理）
     * gen by moon at 8/10/2022, 3:34:49 AM
     */
    @PostMapping("/oms/mgt/org/queryArchiveDept")
    @ApiOperation(value = "B1-3查询存档部门条件（管理）", response = OkrResult.class)
    public OkrResult<BffQueryArchiveDeptRespDto> queryArchiveDept(@RequestBody(required = false) @Validated BffQueryArchiveDeptReqDto reqDTO) {
        return OkrResult.success(orgService.queryArchiveDept(reqDTO));
    }

    /**
     * B1-3查询一级部门列表（边界）
     * gen by moon at 10/19/2022, 8:59:17 PM
     */
    @PostMapping("/oms/org/queryOneLevelDeptList")
    @ApiOperation(value = "B1-3查询一级部门列表（边界）", response = OkrResult.class)
    public OkrResult<BffQueryOneLevelDeptListRespDto> queryOneLevelDeptList(@RequestBody(required = false) @Validated BffQueryOneLevelDeptListReqDto reqDTO) {
        return OkrResult.success(orgService.queryOneLevelDeptList(reqDTO));
    }

    /**
     * B1-3存档部门（管理）
     * gen by moon at 9/2/2022, 8:54:34 PM
     */
    @PostMapping("/oms/mgt/org/archiveDept")
    @ApiOperation(value = "B1-3存档部门（管理）", response = OkrResult.class)
    public OkrResult<BffArchiveDeptRespDto> archiveDept(@RequestBody(required = false) @Validated BffArchiveDeptReqDto reqDTO) {
        return OkrResult.success(orgService.archiveDept(reqDTO));
    }

    /**
     * B1-3查询部门详情
     * gen by moon at 9/14/2022, 12:26:29 AM
     */
    @PostMapping("/oms/org/queryDeptDetail")
    @ApiOperation(value = "B1-3查询部门详情", response = OkrResult.class)
    public OkrResult<BffQueryDeptDetailRespDto> queryDeptDetail(@RequestBody(required = false) @Validated BffQueryDeptDetailReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptDetail(reqDTO));
    }

    /**
     * B1-3修改部门（管理）
     * gen by moon at 9/4/2022, 9:56:37 PM
     */
    @PostMapping("/oms/mgt/org/updateDept")
    @ApiOperation(value = "B1-3修改部门（管理）", response = OkrResult.class)
    public OkrResult<BffUpdateDeptRespDto> updateDept(@RequestBody(required = false) @Validated BffUpdateDeptReqDto reqDTO) {
        return OkrResult.success(orgService.updateDept(reqDTO));
    }

    /**
     * B1-3查询管理模式部门详情(管理)
     * gen by moon at 9/14/2022, 1:37:01 AM
     */
    @PostMapping("/oms/mgt/org/queryDeptMgtDetail")
    @ApiOperation(value = "B1-3查询管理模式部门详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryDeptMgtDetailRespDto> queryDeptMgtDetail(@RequestBody(required = false) @Validated BffQueryDeptMgtDetailReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptMgtDetail(reqDTO));
    }

    /**
     * B1-3查询管理模式部门树状结构(管理)
     * gen by moon at 8/20/2022, 5:53:21 PM
     */
    @PostMapping("/oms/mgt/org/queryDeptMgtTreeList")
    @ApiOperation(value = "B1-3查询管理模式部门树状结构(管理)", response = OkrResult.class)
    public OkrResult<BffQueryDeptMgtTreeListRespDto> queryDeptMgtTreeList(@RequestBody(required = false) @Validated BffQueryDeptMgtTreeListReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptMgtTreeList(reqDTO));
    }

    /**
     * B1-3判断部门开始管理权限(管理)
     * gen by moon at 8/25/2022, 10:15:58 PM
     */
    @PostMapping("/oms/mgt/org/judgeEnterDeptMgtPower")
    @ApiOperation(value = "B1-3判断部门开始管理权限(管理)", response = OkrResult.class)
    public OkrResult<BffJudgeEnterDeptMgtPowerRespDto> judgeEnterDeptMgtPower(@RequestBody(required = false) @Validated BffJudgeEnterDeptMgtPowerReqDto reqDTO) {
        return OkrResult.success(orgService.judgeEnterDeptMgtPower(reqDTO));
    }

    /**
     * B1-3查询最高组织详情
     * gen by moon at 8/20/2022, 5:53:44 PM
     */
    @PostMapping("/oms/org/querySupremeOrgDetail")
    @ApiOperation(value = "B1-3查询最高组织详情", response = OkrResult.class)
    public OkrResult<BffQuerySupremeOrgDetailRespDto> querySupremeOrgDetail(@RequestBody(required = false) @Validated BffQuerySupremeOrgDetailReqDto reqDTO) {
        return OkrResult.success(orgService.querySupremeOrgDetail(reqDTO));
    }

    /**
     * B1-3更新组织管理检查项状态等(管理)
     * gen by moon at 9/1/2022, 7:22:03 PM
     */
    @PostMapping("/oms/mgt/org/refreshOrgMgtCheckItemEtc")
    @ApiOperation(value = "B1-3更新组织管理检查项状态等(管理)", response = OkrResult.class)
    public OkrResult<BffRefreshOrgMgtCheckItemEtcRespDto> refreshOrgMgtCheckItemEtc(@RequestBody(required = false) @Validated BffRefreshOrgMgtCheckItemEtcReqDto reqDTO) {
        return OkrResult.success(orgService.refreshOrgMgtCheckItemEtc(reqDTO));
    }

    /**
     * B1查询一级部门权限管理入口详情(管理)
     * gen by moon at 8/24/2022, 11:48:36 PM
     */
    @PostMapping("/oms/mgt/org/queryFirstDeptPowerManagePortalDetail")
    @ApiOperation(value = "B1查询一级部门权限管理入口详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryFirstDeptPowerManagePortalDetailRespDto> queryFirstDeptPowerManagePortalDetail(@RequestBody(required = false) @Validated BffQueryFirstDeptPowerManagePortalDetailReqDto reqDTO) {
        return OkrResult.success(orgService.queryFirstDeptPowerManagePortalDetail(reqDTO));
    }

    /**
     * B1-3修改组织当前管理对象部门等(管理)
     * gen by moon at 8/28/2022, 12:12:42 AM
     */
    @PostMapping("/oms/mgt/org/updateOrgPresentMgtObjType")
    @ApiOperation(value = "B1-3修改组织当前管理对象部门等(管理)", response = OkrResult.class)
    public OkrResult<BffUpdateOrgPresentMgtObjTypeRespDto> updateOrgPresentMgtObjType(@RequestBody(required = false) @Validated BffUpdateOrgPresentMgtObjTypeReqDto reqDTO) {
        return OkrResult.success(orgService.updateOrgPresentMgtObjType(reqDTO));
    }

    /**
     * B1-3查询组织使用锁定原因
     * gen by moon at 8/25/2022, 10:16:00 PM
     */
    @PostMapping("/oms/org/queryOrgUseLockCauseDetail")
    @ApiOperation(value = "B1-3查询组织使用锁定原因", response = OkrResult.class)
    public OkrResult<BffQueryOrgUseLockCauseDetailRespDto> queryOrgUseLockCauseDetail(@RequestBody(required = false) @Validated BffQueryOrgUseLockCauseDetailReqDto reqDTO) {
        return OkrResult.success(orgService.queryOrgUseLockCauseDetail(reqDTO));
    }

    /**
     * B1-查询组织架构发布进度详情
     * gen by moon at 8/30/2022, 12:00:29 AM
     */
    @PostMapping("/oms/org/queryOrgStrReleaseProgressDetail")
    @ApiOperation(value = "B1-查询组织架构发布进度详情", response = OkrResult.class)
    public OkrResult<BffQueryOrgStrReleaseProgressDetailRespDto> queryOrgStrReleaseProgressDetail(@RequestBody(required = false) @Validated BffQueryOrgStrReleaseProgressDetailReqDto reqDTO) {
        return OkrResult.success(orgService.queryOrgStrReleaseProgressDetail(reqDTO));
    }

    /**
     * B1-3暂停成员对外使用(管理)
     * gen by moon at 9/11/2022, 5:18:43 AM
     */
    @PostMapping("/oms/mgt/org/suspendExternalUseMembers")
    @ApiOperation(value = "B1-3暂停成员对外使用(管理)", response = OkrResult.class)
    public OkrResult<BffSuspendExternalUseMembersRespDto> suspendExternalUseMembers(@RequestBody(required = false) @Validated BffSuspendExternalUseMembersReqDto reqDTO) {
        return OkrResult.success(orgService.suspendExternalUseMembers(reqDTO));
    }

    /**
     * B1-3恢复成员对外使用(管理)
     * gen by moon at 9/11/2022, 5:18:44 AM
     */
    @PostMapping("/oms/mgt/org/recoveryExternalUseMembers")
    @ApiOperation(value = "B1-3恢复成员对外使用(管理)", response = OkrResult.class)
    public OkrResult<BffRecoveryExternalUseMembersRespDto> recoveryExternalUseMembers(@RequestBody(required = false) @Validated BffRecoveryExternalUseMembersReqDto reqDTO) {
        return OkrResult.success(orgService.recoveryExternalUseMembers(reqDTO));
    }

    /**
     * B1-3查询部门边界树状结构(边界)
     * gen by moon at 9/19/2022, 7:29:12 PM
     */
    @PostMapping("/oms/org/queryDeptBorderTreeListBorder")
    @ApiOperation(value = "B1-3查询部门边界树状结构(边界)", response = OkrResult.class)
    public OkrResult<BffQueryDeptBorderTreeListBorderRespDto> queryDeptBorderTreeListBorder(@RequestBody(required = false) @Validated BffQueryDeptBorderTreeListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryDeptBorderTreeListBorder(reqDTO));
    }

    /**
     * B1-3查询下级直属部门列表(边界)
     * gen by moon at 9/19/2022, 7:28:32 PM
     */
    @PostMapping("/oms/org/querySubordinateDirectlyDeptListBorder")
    @ApiOperation(value = "B1-3查询下级直属部门列表(边界)", response = OkrResult.class)
    public OkrResult<BffQuerySubordinateDirectlyDeptListBorderRespDto> querySubordinateDirectlyDeptListBorder(@RequestBody(required = false) @Validated BffQuerySubordinateDirectlyDeptListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.querySubordinateDirectlyDeptListBorder(reqDTO));
    }

    /**
     * B1-3部门ID查部门树状结构(边界)
     * gen by moon at 10/14/2022, 4:05:41 PM
     */
    @PostMapping("/oms/org/querySuperiorDeptQueryDeptTreeTreeListBorder")
    @ApiOperation(value = "B1-3部门ID查部门树状结构(边界)", response = OkrResult.class)
    public OkrResult<BffQuerySuperiorDeptQueryDeptTreeTreeListBorderRespDto> querySuperiorDeptQueryDeptTreeTreeListBorder(@RequestBody(required = false) @Validated BffQuerySuperiorDeptQueryDeptTreeTreeListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.querySuperiorDeptQueryDeptTreeTreeListBorder(reqDTO));
    }

    /**
     * B1-3部门ID查询直属部门列表(边界)
     * gen by moon at 10/14/2022, 4:05:43 PM
     */
    @PostMapping("/oms/org/querySuperiorDeptMayDivDeptListBorder")
    @ApiOperation(value = "B1-3部门ID查询直属部门列表(边界)", response = OkrResult.class)
    public OkrResult<BffQuerySuperiorDeptMayDivDeptListBorderRespDto> querySuperiorDeptMayDivDeptListBorder(@RequestBody(required = false) @Validated BffQuerySuperiorDeptMayDivDeptListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.querySuperiorDeptMayDivDeptListBorder(reqDTO));
    }

    /**
     * B1-3类型字典查部门树状结构(管理)
     * gen by moon at 10/14/2022, 4:05:48 PM
     */
    @PostMapping("/oms/mgt/org/queryTypeFieldQueryDeptTreeTreeList")
    @ApiOperation(value = "B1-3类型字典查部门树状结构(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTypeFieldQueryDeptTreeTreeListRespDto> queryTypeFieldQueryDeptTreeTreeList(@RequestBody(required = false) @Validated BffQueryTypeFieldQueryDeptTreeTreeListReqDto reqDTO) {
        return OkrResult.success(orgService.queryTypeFieldQueryDeptTreeTreeList(reqDTO));
    }

    /**
     * B1-3类型字典查直属部门列表(边界)
     * gen by moon at 10/14/2022, 4:05:50 PM
     */
    @PostMapping("/oms/org/queryTypeFieldDirectlyDeptListBorder")
    @ApiOperation(value = "B1-3类型字典查直属部门列表(边界)", response = OkrResult.class)
    public OkrResult<BffQueryTypeFieldDirectlyDeptListBorderRespDto> queryTypeFieldDirectlyDeptListBorder(@RequestBody(required = false) @Validated BffQueryTypeFieldDirectlyDeptListBorderReqDto reqDTO) {
        return OkrResult.success(orgService.queryTypeFieldDirectlyDeptListBorder(reqDTO));
    }

    /**
     * B1-3判断组织架构维护状态(公共)
     * gen by moon at 10/16/2022, 10:16:14 PM
     */
    @PostMapping("/oms/org/judgeOrgMaintenanceStatusCom")
    @ApiOperation(value = "B1-3判断组织架构维护状态(公共)", response = OkrResult.class)
    public OkrResult<BffJudgeOrgMaintenanceStatusComRespDto> judgeOrgMaintenanceStatusCom(@RequestBody(required = false) @Validated BffJudgeOrgMaintenanceStatusComReqDto reqDTO) {
        return OkrResult.success(orgService.judgeOrgMaintenanceStatusCom(reqDTO));
    }

    /**
     * B1-执行API对接员工信息(管理)
     * gen by moon at 9/16/2023, 2:59:46 PM
     */
    @PostMapping("/oms/mgt/org/implementApiDockingPersonInfo")
    @ApiOperation(value = "B1-执行API对接员工信息(管理)", response = OkrResult.class)
    public OkrResult<BffImplementApiDockingPersonInfoRespDto> implementApiDockingPersonInfo(@RequestBody(required = false) @Validated BffImplementApiDockingPersonInfoReqDto reqDTO) {
        return OkrResult.success(orgService.implementApiDockingPersonInfo(reqDTO));
    }

    /**
     * B1-执行API对接部门信息(管理)
     * gen by moon at 9/16/2023, 2:59:54 PM
     */
    @PostMapping("/oms/mgt/org/implementOrgImportDeptDataByApi")
    @ApiOperation(value = "B1-执行API对接部门信息(管理)", response = OkrResult.class)
    public OkrResult<BffImplementOrgImportDeptDataByApiRespDto> implementOrgImportDeptDataByApi(@RequestBody(required = false) @Validated BffImplementOrgImportDeptDataByApiReqDto reqDTO) {
        return OkrResult.success(orgService.implementOrgImportDeptDataByApi(reqDTO));
    }
}
